package com.ys.util.admin;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class ConditionUtil {
	public static String getConditionValue(String conditions, String field) {
		String str = null;
		if (conditions != null && conditions.length() > 0) {
			JSONArray conditionJA = JSON.parseArray(conditions);
			for (int i = 0; i < conditionJA.size(); i++) {
				JSONObject conditionJO = conditionJA.getJSONObject(i);
				String field2 = conditionJO.getString("field");
				if (field2.equals(field)) {
					str = conditionJO.getString("value");
					return str;
				}
			}
		}
		return str;
	}
}
